package com.anuo.app.study.studyjavabestpractice;

import com.anuo.app.modules.user.entity.UserFilter;
import com.anuo.app.modules.user.service.UserService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;


import java.util.ArrayList;
import java.util.List;

@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextConfiguration(locations = {"classpath:spring/spring-context.xml"})
public class StudyCollectionBest {
    @Autowired
    UserService userService;
    public static void main(String[] args) {

    }

    @Test
    public void listToArray(){
        List<String> list = new ArrayList<>();
        list.add("anuo");
        list.add("jk");
        String[] array = new String[list.size()];
        array = list.toArray(array);
        for (String s : array) {
            System.out.println(s);
        }
        UserFilter userFilter = new UserFilter();
        userService.getUser(userFilter);

    }

}
